﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Media;
using System.Reflection;

namespace SharpMap.Presentation.Wpf
{
    public class ColorsSource : ObservableCollection<ColorEntry>
    {

        public ColorsSource()
        {
            
            PropertyInfo[] propInfo = typeof(Colors).GetProperties();
            foreach (PropertyInfo p in propInfo)
            {
                ColorEntry entry = new ColorEntry();
            }

        }
    }

    public class ColorEntry 
    {
        Color _color;
        string _name = null;

        public ColorEntry()
        {
            _color = Colors.Transparent;
            _name = "Transparent";
        }

        public ColorEntry(Color clr)
        {
            _color = clr;
        }

        public ColorEntry(Color clr, string name)
        {
            _color = clr;
            _name = name;
        }

        public string Name
        {
            get
            {
                if(_name != null)
                {
                    return _name;
                }
                else
                {
                    return _color.ToString();
                }
            }
        }

        public Color Color
        {
            get { return _color; }
        }
    }
}
